package cn.ssm.service.serviceImpl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.ssm.dao.MoviesDetailMapper;
import cn.ssm.pojo.Movie;
import cn.ssm.pojo.MovieCount;
import cn.ssm.service.MoviesDetailService;

/**
 * 电影类接口实现类
 * @author 戴耀辉
 *
 */
@Service
public class MoviesDetailServiceImpl implements MoviesDetailService {
	
	@Autowired
	private MoviesDetailMapper moviesDetailMapper;
	
	//查询所有电影
	public List<Movie> getMoviesDetailList() {
		return moviesDetailMapper.getMoviesDetailList();
	}

	/**
	 * 模糊查询电影
	 */
	public List<Movie> selectMovies(String movieName) {
		return moviesDetailMapper.selectMovies(movieName);
	}

	/**
	 * 根据ID查询对应的电影
	 */
	public List<Movie> getMovieId(int id) {
		return moviesDetailMapper.getMovieId(id);
	}

	/**
	 * 查询所有电影外链接电影类型表
	 */
	public List<Movie> getMoviesList() {
		return moviesDetailMapper.getMoviesList();
	}

	//根据id查询电影  艾辉
	@Override
	public List<Movie> getMovieById(Integer id) {
		// TODO Auto-generated method stub
		return moviesDetailMapper.getMovieById(id);
	}

	/**
	 * 按照电影类型查询电影
	 * @param movieName
	 * @return
	 */
	@Override
	public List<Movie> selectMovie(int movieTypeId) {
		return moviesDetailMapper.selectMovie(movieTypeId);
	}
	
	
	//<!-- 查询每部热映电影的订单总量  黄少涛 -->	
	@Override
	public List<MovieCount> getMovieOrderCount() {
		
		return moviesDetailMapper.getMovieOrderCount();
	}
	

	@Override
	public int getMoviesDetail() {
		return moviesDetailMapper.getMoviesDetail();
	}

	@Override
	public List<Movie> getNewMoviesList() {
		return moviesDetailMapper.getNewMoviesList();
	}
	
	@Override
	public int getMoviesCount() {
		return moviesDetailMapper.getMoviesCount();
	}

	@Override
	public int deleteMovies(Integer id) {
		return moviesDetailMapper.deleteMovies(id);
	}

	@Override
	public List<Movie> getMovies(Map<String, Object> paramas) {
		return moviesDetailMapper.getMovies(paramas);
	}

	/**
	 * 添加电影--朱海松
	 * @param paramas
	 * @return
	 */
	@Override
	public int saveMovies(Map<String, Object> params) {
		return moviesDetailMapper.saveMovies(params);
	}
}
